import React from 'react'
import './css/index.css'
import Header from '../index/component/header'
import SearchBar from '../index/component/SearchBar'
import Footer from '../index/component/bottom'
import img from '../img/3.png'
import { useLocation } from 'react-router-dom';
export default function index() {
    const location = useLocation();
    const product = location.state;
    console.log(product);
  return (
    <div className='index'>
     <Header></Header>
      <SearchBar></SearchBar>
      <div className='addcart'>
        <div>
            <img src={img} alt="" />
        </div>
        <div className='addcart-context'>
            <div className='addcart-context-left'>
                <img src={product.image[0]} alt="" />
                <div>
                   <p>{product.description}</p>
                   <p>{product.name} | {product.price}￥</p>
                </div>
            </div>
            <div className='addcart-context-right'>
                <button>去购物车结算</button>
            </div>
        </div>
      </div>
      <Footer></Footer>

    </div>
  )
}
